<link rel="stylesheet" href="/lib/editor.md/css/editormd.min.css" />
<script src="/lib/editor.md/editormd.js"></script>
<script src="/js/edit.js"></script>
<div class="container">
    <!-- 提示信息 -->
    <div class="alert alert-warning" id="alert-msg" style="display: none;">
        <a class="close" data-dismiss="alert" id="opt-alert-msg">&times;</a>
        <span id="msg-content"></span>
    </div>
    <div style="width: 100%;">
        <!-- 文本框 -->
        <div class="form-group fl" style="width:70%;">
            <input type="text" class="form-control" id="file-name" value="<%= data ?data.fileName:'' %>" placeholder="请输入文档名称">
            <input type="hidden" class="form-control" id="file-id" value="<%= data ?data._id:'' %>">
        </div>
        <!-- 操作框 -->
        <div class="btn-toolbar fr" style="width: 28%;">
            <div class="btn-group">
                <button type="button" class="btn btn-info" id="opt-dmt-save">保存</button>
                <button type="button" class="btn btn-default" id="opt-edit-new">新建文档</button>
                <button type="button" class="btn btn-default" id="opt-to-list">返回列表</button>
                <button type="button" class="btn btn-default" id="opt-preview" style="display: none;">预览文档</button>
            </div>
        </div>
    </div>
    <div class="clearfix"></div>
    <div id="editormd">
        <% if (data) { -%>
            <textarea style="display:none;"><%= data.mdContent %></textarea>
        <% } else { -%>
            <textarea style="display:none;">### 请输入标题</textarea>
        <% } -%>
    </div>
</div>